<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>script</p>
    <h1 id="con">做为一个Web开发师来说，如果你想提供漂亮的网页、令用户满意的上网体验，JavaScript是必不可少的工具。</h1>
    <button onclick="none()">隐藏内容</button>
    <button onclick="block()">显示内容</button>
    <script>
        var spp = document.getElementById('con');
        function none(){
            spp.style.display = 'none';
        }
        function block(){
            spp.style.display='block'
        }
        window.open=confirm('喜好')
    </script>
</body>
</html>